package cn.amebius.simpledocker.entity.po;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * tb_role_permission_relation的Po
 * @author 阿伟
 * @date 2023/7/31 13:34
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class RolePermissionRelationPo extends BasePo{

    private Integer roleId;

    private Integer permissionId;

    public static void check(RolePermissionRelationPo rprp) {
        if (rprp == null || rprp.roleId.toString().isEmpty() || rprp.permissionId.toString().isEmpty()) {
            throw new DataErrorException("数据异常:角色权限丢失");
        }
        BasePo.check(rprp);
    }

}
